package com.ibuonline.b2b.entity;

import java.io.Serializable;

import com.ibuonline.b2b.entity.CompanyContact;

public class ProdContact implements Serializable {

	private static final long serialVersionUID = -3116665236990720300L;

	//fields
	private java.lang.Long id;
	private java.lang.Long prodId;
	private java.lang.Integer contactId;

	//default constructor
	public ProdContact() {
	}

	//getter
	public java.lang.Long getId() {
		return id;
	}
	public java.lang.Long getProdId() {
		return prodId;
	}
	public java.lang.Integer getContactId() {
		return contactId;
	}

	//setter
	public void setId(java.lang.Long id) {
		this.id = id;
	}
	public void setProdId(java.lang.Long prodId) {
		this.prodId = prodId;
	}
	public void setContactId(java.lang.Integer contactId) {
		this.contactId = contactId;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof ProdContact))
			return false;

		final ProdContact prodContact = (ProdContact)other;
		if (!this.id.equals(prodContact.getId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(id).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("ProdContact[")
			.append("id=").append(id).append(", ")
			.append("prodId=").append(prodId).append(", ")
			.append("contactId=").append(contactId).append("]").toString();
	}
	////////#################
	private Product product;
	private CompanyContact contact;

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public CompanyContact getContact() {
		return contact;
	}

	public void setContact(CompanyContact contact) {
		this.contact = contact;
	}
	
}